home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / AppleScript / Development Tools / Interfaces / AppleScript 1.0 Interfaces / CIncludes / OSAGeneric.h < prev   
Encoding:
Text File  |  1993-04-08  |  3.5 KB  |  80 lines  |  [TEXT/MPS ]

  1. ////////////////////////////////////////////////////////////////////////////////
  2. // OPEN SCRIPTING ARCHITECTURE: Generic Component Interface
  3. ////////////////////////////////////////////////////////////////////////////////
  4. // Copyright © 1992 Apple Computer, Inc. All rights reserved.
  5. // Authors: Jens Alfke, William Cook, Donn Denman, and Warren Harris
  6. ////////////////////////////////////////////////////////////////////////////////
  7. // This interface defines a "generic scripting component."
  8. // The Generic Scripting Component allows automatic dispatch to a
  9. // specific scripting component that conforms to the OSA interface.
  10. // This component supports OSA, by calling AppleScript or some other 
  11. // scripting component.  Additionally it provides access to the default
  12. // and the user-prefered scripting component.
  13. ////////////////////////////////////////////////////////////////////////////////
  14.  
  15. #ifndef __OSAGeneric__
  16. #define __OSAGeneric__
  17.  
  18. #ifndef __OSA__
  19. #include "OSA.h"
  20. #endif
  21.  
  22. #define errOSAComponentMismatch            -1761    // Parameters are from 2 different components
  23. #define errOSACantOpenComponent            -1762    // Can't connect to scripting system with that ID
  24.  
  25. #define kGenericComponentVersion    0x0100        // Component version this header file describes
  26.  
  27. #define    kGSSSelectGetDefaultScriptingComponent        0x1001    // == kOSASelectComponentSpecificStart
  28. #define    kGSSSelectSetDefaultScriptingComponent        0x1002
  29. #define    kGSSSelectGetScriptingComponent                0x1003
  30. #define    kGSSSelectGetScriptingComponentFromStored    0x1004
  31. #define kGSSSelectGenericToRealID                    0x1005
  32. #define kGSSSelectRealToGenericID                    0x1006
  33. #define kGSSSelectOutOfRange                        0x1007
  34.  
  35. typedef OSType            ScriptingComponentSelector;
  36. typedef OSAID            GenericID;
  37.  
  38. // get and set the default scripting component
  39. pascal OSAError 
  40. OSAGetDefaultScriptingComponent( ComponentInstance genericScriptingComponent,
  41.                             ScriptingComponentSelector* scriptingSubType)            // out
  42.                     = ComponentCallNow(kGSSSelectGetDefaultScriptingComponent, 4);
  43.     
  44. pascal OSAError 
  45. OSASetDefaultScriptingComponent( ComponentInstance genericScriptingComponent,
  46.                                  ScriptingComponentSelector scriptingSubType )        // in
  47.             = ComponentCallNow(kGSSSelectSetDefaultScriptingComponent, 4);
  48.  
  49. // get a scripting component instance from its subtype code
  50. pascal OSAError 
  51. OSAGetScriptingComponent( ComponentInstance genericScriptingComponent,
  52.                           ScriptingComponentSelector scriptingSubType,                 // in
  53.                           ComponentInstance* scriptingInstance )                    // out
  54.             = ComponentCallNow(kGSSSelectGetScriptingComponent, 8);
  55.  
  56. // get a scripting component selector (subType) from a stored script
  57. pascal OSAError 
  58. OSAGetScriptingComponentFromStored( ComponentInstance genericScriptingComponent,
  59.                                     const AEDesc *scriptData,                         // in
  60.                                     ScriptingComponentSelector* scriptingSubType )    // out
  61.             = ComponentCallNow(kGSSSelectGetScriptingComponentFromStored, 8);
  62.  
  63. // get a real component instance and script id from a generic id
  64. pascal OSAError 
  65. OSAGenericToRealID( ComponentInstance genericScriptingComponent,
  66.                     OSAID *theScriptID,                                                // in/out
  67.                     ComponentInstance *theExactComponent )                            // out
  68.             = ComponentCallNow(kGSSSelectGenericToRealID, 8);
  69.  
  70. // get a generic id from a real component instance and script id
  71. pascal OSAError 
  72. OSARealToGenericID( ComponentInstance genericScriptingComponent,
  73.                     OSAID *theScriptID,                                                // in/out
  74.                     ComponentInstance theExactComponent )                            // in
  75.             = ComponentCallNow(kGSSSelectRealToGenericID, 8);
  76.  
  77. #endif    // ifdef __OSAGeneric__
  78. //////////////////////////////////////////////////////////////////////////////////////////////////////
  79.  
  80.